import Vue from 'vue'
import Router from 'vue-router'

import ElementUI from 'element-ui'

Vue.use(Router)
Vue.use(ElementUI)


export default new Router({
  routes: [
    {
      path: '/',
      redirect: 'loginUser'
    },
 
    {
      path: '/loginUser',
      component: () => import('../views/user/LoginUser.vue'),
      meta: {title: '登录'}
    },
    {
      path: '/loginAdmin',
      component: () => import('../views/admin/LoginAdmin.vue'),
      meta: {title: '登录'}
    },
 
    {
      path: '/homeAdmin',
      component: () => import('../views/admin/HomeAdmin.vue'),
      meta: {title: '首页'},
      children: [
        {
          path:'/allPerson',
          component: () =>import('../views/admin/AllPerson.vue'),
          meta: {title:'所有人员信息'}
        },
        {
          path:'/unRegister',
          component: () =>import('../views/admin/UnRegister.vue'),
          meta: {title:'未登记人员信息'}
        },
        {
          path:'/userChange',
          component: () =>import('../views/admin/UserChange.vue'),
          meta: {title:'用户管理'}
        },
        
      ]
    },
    {
      path: '/homeUser',
      component: () => import('../views/user/HomeUser.vue'),
      meta: {title: '首页'},
      children: [
        {
          path:'/userCenter',
          component: () =>import('../views/user/UserCenter'),
          meta: {title:'用户管理'}
        },
        {
          path:'/historyRegister',
          component: () =>import('../views/user/HistoryRegister.vue'),
          meta: {title:'所有人员信息'}
        },
        {
          path:'/Register',
          component: () =>import('../views/user/Register'),
          meta: {title:'健康信息登记'}
        },

        
      ]
    },
            
    {
      path: '*',
      redirect: '/404'
    }
  ]
});
